package com.gxgeek.spring.security.validator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @author gaoxing
 * @create 2017-09-30 上午10:44
 */
@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
//被 spring 扫描  同时  把 GxConstraintValidator  放入spring 容器
@Constraint(validatedBy = GxConstraintValidator.class)
public @interface GxConstraint {
    //下面三个属性 是 校验框架 必须要的 框架规定
    String message();

    Class<?>[] groups() default { };

    Class<? extends Payload>[] payload() default { };

}
